import { defineStore } from "pinia";

export const useMapStore = defineStore("mapStore", {
    state: () => {
        return {
            mapInstance: null, // 地图实例
            mapToolInstance: null, // 地图工具实例
            mapLocaInstance: null, // 地图Loca实例
            mapPolygonInstance: null, // 地图多边形实例
            mapMassMarksInstance: null, // 地图海量点标记实例
            districtExplorerInstance: null, // 地图查询工具
            mapHeatInstance: null // 地图热力图层实例
        }
    },
    actions: {
        setMapToolInstance(instance) {
            this.mapToolInstance = instance
        },
        setMapInstance(instance) {
            this.mapInstance = instance
        },
        setMapLocaInstance(instance) {
            this.mapLocaInstance = instance
        },
        setMapPolygonInstance(instance) {
            this.mapPolygonInstance = instance
        },
        setMapMassMarksInstance(instance) {
            this.mapMassMarksInstance = instance
        },
        setDistrictExplorerInstance(instance) {
            this.districtExplorerInstance = instance
        },
        setMapHeatInstance(instance) {
            this.mapHeatInstance = instance
        }
    }
})